package com.xyazm.order.controller;


import com.xyazm.common.page.PagingInfo;
import com.xyazm.order.domain.dto.OrderDetailDTO;
import com.xyazm.order.domain.dto.OrderListDTO;
import com.xyazm.order.domain.param.QueryOrderDetailParam;
import com.xyazm.order.domain.param.QueryOrderParam;
import com.xyazm.order.service.IOrderQueryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 * 订单查询
 * </p>
 */
@RestController
@RequestMapping("/order/query")
public class OrderQueryController {


    @Autowired
    private IOrderQueryService orderQueryService;

    /**
     * 查询订单列表
     * @author xuyou
     * @date: 2022/6/24 11:10
     */
    @PostMapping("/listOrders")
    public PagingInfo<OrderListDTO> listOrders(@RequestBody QueryOrderParam param) {
        PagingInfo<OrderListDTO> result = orderQueryService.listOrders(param);
        return result;
    }

    /**
     * 查询订单详情 
     * @author xuyou
     * @date: 2022/6/24 14:58
     * @param: orderId
     */
    @PostMapping("/orderDetail")
    public OrderDetailDTO orderDetail(@RequestBody QueryOrderDetailParam param) {
        OrderDetailDTO result = orderQueryService.orderDetail(param);
        return result;
    }



}
